package cn.dankal.slidebarlib;

import android.text.TextUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class BrandBean{
   public String uuid;
   public String brandName;
   public String avatar;
   public String createTime;
   public String pinyin;

   public String getSection(){
      if (TextUtils.isEmpty(pinyin)) {
         return "#";
      } else {
         String c = pinyin.substring(0, 1);
         Pattern p = Pattern.compile("[a-zA-Z]");
         Matcher m = p.matcher(c);
         if (m.matches()) {
            return c.toUpperCase();
         }
         else
            return "#";
      }
   }

   public void setPinyin(String pinyin) {
      this.pinyin = pinyin;
   }
}